package com.lxc.provider.api;

import com.alibaba.fastjson.JSON;
import com.lxc.apigatewaysdk.annotation.ApiProducerClazz;
import com.lxc.apigatewaysdk.annotation.ApiProducerMethod;
import com.lxc.common.HelloTestService;
import com.lxc.common.UserEntity;
import org.apache.dubbo.config.annotation.Service;



/**
 * @author lxc18
 * @date 2024/12/2 14:29
 * @description HelloTestServiceImpl
 */
@ApiProducerClazz(interfaceName = "Hello测试RPC接口",interfaceVersion = "1.0.1")
@Service(interfaceClass = HelloTestService.class)
public class HelloTestServiceImpl implements HelloTestService {
    @Override
    @ApiProducerMethod(methodName = "sayTestHi方法",uri = "/sayTestHi",httpCommandType = "GET",auth = 0)
    public String sayTestHi(String message) {
        return "Hi Message"+message;
    }

    @Override
    @ApiProducerMethod(methodName = "sayTestHello方法",uri = "/sayTestHello",httpCommandType = "GET",auth = 0)
    public String sayTestHello(String message) {
        return "Hello Message"+message;
    }

    @Override
    @ApiProducerMethod(methodName = "sayUserInfo方法",uri = "/sayUserInfo",httpCommandType = "POST",auth = 1)
    public String sayUserInfo(UserEntity user) {
        return "hello JSON"+ JSON.toJSONString(user);

    }

    @Override
    @ApiProducerMethod(methodName = "sayUserInfoMessage方法",uri = "/sayUserInfoMessage",httpCommandType = "POST",auth = 1)
    public String sayUserInfoMessage(String message, UserEntity user) {
        return "hello JSON and Message"+ JSON.toJSONString(user)+message;
    }
}
